package cn.meye11.crm.domain.entity;

import cn.meye11.crm.domain.model.Item;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.annotation.LogicDelete;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 项目表(Item)类
 *
 * @author makejava
 * @since 2023-11-18 19:20:43
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table(name = ItemEntity.Table)
public class ItemEntity implements Serializable {

    public static final String Table = "t_item";
    private static final long serialVersionUID = 244013566448834977L;
    
    public ItemEntity(Item model) {
        BeanUtils.copyProperties(model, this);
    }

    @Id
    @KeySql(useGeneratedKeys = true)
    @Column(insertable = false)
    private Long id;
    /* 项目名称 */
    private String name;
    /* 项目代码 */
    private String code;
    /* 含税价格 */
    private Double price;
    /* 未税价格 */
    private Double untaxedPrice;
    /* 税率 */
    private Double taxRate;
    /* 服务内容 */
    private String serviceContent;
    /* 标签 */
    private String label;
    /* 是否删除 */
    @LogicDelete
    private Integer del;
    /* 最后修改时间 */
    private LocalDateTime last;
    /* 创建时间 */
    private LocalDateTime time;
    /* 创建人 */
    private String createdBy;
    /* 最后修改人 */
    private String modifiedBy;
    /* 版本 */
//    @Version
    private Integer version;

}
